package com.example.javachatroomextend.service;

import com.example.javachatroomextend.mapper.UserMapper;
import com.example.javachatroomextend.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User getUserByName(String username) {
        return userMapper.getUserByName(username);
    }

    public Integer addUser(String username,String password,String image) {
        return userMapper.addUser(username,password,image);
    }

    public User getUserByUserId(Integer userId) {
        return userMapper.getUserByUserId(userId);
    }
}
